<ul class="breadcrumb">
	<li><a href="{$BASE_PATH}financeiro/lancamento">Lançamento</a></li>
	<li class='active'>Cadastrar/Editar</li>
</ul>
<form action='{$BASE_PATH}' method="post" enctype="multipart/form-data" class='sideBySide validate'>
{$form->getElement('application')->render()}
{$form->getElement('controller')->render()}
{$form->getElement('method')->render()}
{$form->getElement('lancamento[idlancamento]')->render()}
<div class="control-group">
	{$form->getElement('lancamento[tpnatureza]')->getLabel()->render()}
	<div class="controls">
		{$form->getElement('lancamento[tpnatureza]')->render()}
	</div>
</div>
<div class="control-group">
	{$form->getElement('lancamento[agente]')->getLabel()->render()}
	<div class="controls">
		{$form->getElement('lancamento[agente]')->render()}
	</div>
</div>
<div class="control-group">
	{$form->getElement('lancamento[categoria]')->getLabel()->render()}
	<div class="controls">
		{$form->getElement('lancamento[categoria]')->render()}
	</div>
</div>
<div class="control-group">
	{$form->getElement('lancamento[vllancamento]')->getLabel()->render()}
	<div class="controls">
		{$form->getElement('lancamento[vllancamento]')->render()}
	</div>
</div>
<div class="control-group">
	{$form->getElement('lancamento[dsnome]')->getLabel()->render()}
	<div class="controls">
		{$form->getElement('lancamento[dsnome]')->render()}
	</div>
</div>
<div class="control-group">
	{$form->getElement('lancamento[dtvencimento]')->getLabel()->render()}
	<div class="controls">
		{$form->getElement('lancamento[dtvencimento]')->render()}
	</div>
</div>
<div class="control-group">
	{$form->getElement('lancamento[dtcompetencia]')->getLabel()->render()}
	<div class="controls">
		{$form->getElement('lancamento[dtcompetencia]')->render()}
	</div>
</div>
<div class="control-group">
	{$form->getElement('lancamento[dsobservacao]')->getLabel()->render()}
	<div class="controls">
		{$form->getElement('lancamento[dsobservacao]')->render()}
	</div>
</div>
<div class="boxActions">
	{$form->getElement('salvar')->render()}
</div>
</form>

{literal}
<script type="text/javascript">
	$(document).ready(function() {
		$('#id_lancamento_tpnatureza').change(function(){
			$.getJSON(BASE_PATH+'financeiro/categoria/returnCategoria/tpnatureza/'+this.value)
			.success(function(data){
				$("#id_lancamento_categoria option").remove();
				$('#id_lancamento_categoria').append($("<option />").val(null).text('-- Selecione --'));
				
				$.each(data, function(key,value) {
					$('#id_lancamento_categoria').append($("<option />").val(key).text(value));
				});
			});

			$.getJSON(BASE_PATH+'admin/pessoa/returnPessoa/tpnatureza/'+this.value)
			.success(function(data){
				$("#id_lancamento_agente option").remove();
				$('#id_lancamento_agente').append($("<option />").val(null).text('-- Selecione --'));
				
				$.each(data, function(key,value) {
					$('#id_lancamento_agente').append($("<option />").val(key).text(value));
				});
				
			});
		});
	})
</script>
{/literal}